<?php 

include "dataConfig.php";

if(isset($_REQUEST["uid"])){
    $UID = $_REQUEST["uid"];

    $sql = "SELECT * FROM cart WHERE uid=?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("i", $UID);
    $stmt->execute();

    $listArr = array();
    $result = $stmt->get_result();
    while($row = $result->fetch_assoc()){
        array_push($listArr, $row);
    }
    print_r(json_encode($listArr));

} 